package cn.edu.zafu.bigdata.Yum;

import java.util.Scanner;

public class StudentInfoSystem {
    public static void main(String[] args) {
        StudentManager manager = new StudentManager();
        Scanner scanner = new Scanner(System.in);

        while (true) {
            System.out.println("======= 学生信息管理系统 =======");
            System.out.println("1. 添加学生信息");
            System.out.println("2. 检索学生信息");
            System.out.println("3. 更新学生信息");
            System.out.println("4. 删除学生信息");
            System.out.println("5. 显示所有学生信息");
            System.out.println("6. 退出程序");
            System.out.print("请输入操作编号 (1-6): ");
            String option = scanner.nextLine();

            switch (option) {
                case "1":
                    manager.addStudent();
                    break;
                case "2":
                    manager.retrieveStudentInfo();
                    break;
                case "3":
                    manager.updateStudentInfo();
                    break;
                case "4":
                    manager.deleteStudentInfo();
                    break;
                case "5":
                    manager.displayAllStudents();
                    break;
                case "6":
                    System.out.println("退出程序。");
                    scanner.close();
                    return;
                default:
                    System.out.println("无效的输入，请重新输入。");
                    break;
            }
        }
    }
}